<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<html>
<s:head />
<body>
<!-- 月历 -->
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<script src="/js/jquery.tooltip.min.js" type="text/javascript"></script>

<link rel="stylesheet" href="/css/jquery.tooltip.css" />
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<link rel="stylesheet" type="text/css" href="/css/validator.css" />
<script language="javascript">
	$().ready( function() {
		$('#billDtStParam').datepick({minDate: new Date(${minDate}), maxDate:new Date(${today}),showOn:'both',dateFormat:"yy-mm-dd"}); 
		$('#billDtEdParam').datepick({minDate: new Date(${minDate}), maxDate:new Date(${today}),beforeShow:customRange,showOn: 'both',dateFormat:"yy-mm-dd"});
	});
	function customRange (){
		var startDt = $('#billDtStParam').val(); //起始日
		var endDt = new Date(parseInt(startDt.substring(0,4),10),parseInt(startDt.substring(5,7),10)-1,parseInt(startDt.substring(8,10),10)); //結束日
		return {minDate:endDt,maxDate: new Date(${today})}; 
	}
	function checkAll(obj) {
		$(":input[id*=bk_]").attr('checked',$("#ckall").attr('checked'));
	}
</script>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<br />
<h1>汇款管理</h1>
<div class="data-form"><s:form action="query.do" method="post">
	<b>汇款编号：</b>
	<input name="idParam" type="text" id="idParam"
		value="${idParam}" size="20" maxlength="20">
	<b>汇款日期：</b>
	<input name="billDtStParam" type="text" id="billDtStParam"
		value="${billDtStParam}" size="10" maxlength="10">
    ~ <input name="billDtEdParam" type="text" id="billDtEdParam"
		value="${billDtEdParam}" size="10" maxlength="10">
	<BR>
	单据状态：<s:select label="单据状态" name="statusParam"
		list="statusMenu.options" listKey="key" listValue="value.name"  headerKey="" headerValue="全部" />
	<input type="button" value="搜寻" onClick="this.form.submit();" />
</s:form></div>
<br />
<s:form action="updateAll.do" method="post">
<s:if test="bankList.size > 0">
	<yaodian100:pageutil link="search.do" pagerObj="${pager}" />
	<table class="tb-1" width="100%">
		<thead>
			<tr>
			<th><input type=checkbox name=ckall value="" id=ckall onclick="checkAll(this);"/></th>
				<th>汇款单号</th>
				<th>汇款日期</th>
				<th>帳戶號碼</th>
				<th>帳戶名称</th>
				<th>金额</th>
				<th>订单编号</th>
				<th>建档人员</th>
				<th>建档时间</th>
				<th>状态</th>
				<th>功能</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${bankList}" var="bank" varStatus="rows_index">
				<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''} tdDesc" id="tdDesc" 
				title="订单编号:${bank.orderId}">
				  <td><c:if test='${bank.status == "30"}'><input type=checkbox id="bk_${rows_index.count}" name=bankIdList value="${bank.id}"/></c:if></th>
					<td><a href="view.do?bktId=${bank.id}" />${bank.id}</a></td>
					<td><fmt:formatDate value="${bank.billDate}"
						pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td>${bank.sourceAccountNo}</td>
					<td>${bank.sourceAccountName}</td>
					<td>${bank.amount}</td>
					<td>${bank.orderId}</td>
					<td>${bank.dataEntryMan}</td>
					<td><fmt:formatDate value="${bank.dataEntryDate}"
						pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td>${statusMenu.options[bank.status].name}</td>
					<td><a href="view.do?bktId=${bank.id}" />详细</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<input type="submit" name="send" value="移至待招領">
	<yaodian100:pageutil link="query.do" pagerObj="${pager}" />
</s:if>
</s:form>
</body>
</html>
